<script type="text/javascript">
function tip(id)
{
	if(id==1)
	{
		document.getElementById("tipnav").style.display="block";
	}
	if(id==2)
	{
		document.getElementById("tipnav").style.display="none";
	}
}

function tip1()
{
$("#tipnav").bind("mouseleave",
function()
{
		document.getElementById("tipnav").style.display="none";
}
);
}
</script>
<?php 
$sj=date('Y-m-d H:i:s');
//获取推荐人信息
if($_SESSION["tjr"]==NULL)
{
	$_SESSION["tjr"]=$_GET["rec"]; 
}
//判断是否二级页面
$navheadurl="";
if($tag=="center"||$tag=="fxb"||$tag=="cha"){
  $navheadurl="../";
}
$hcookieusername = $_COOKIE['ddusername']; 
$hcookiepassword = $_COOKIE['ddpassword']; $hnum=0;
if($hcookieusername<>NULL&&$_SESSION["duoduouser"]==NULL)
{	
	$hq = "SELECT * FROM ".$BIAOTOU."user where ddusername='".$hcookieusername."' and ddpassword='".$hcookiepassword."'";
	$hrs = mysql_query($hq);
	$hnum = mysql_num_rows($hrs);
	
	if($hnum!=0)
	{   
		while($row = mysql_fetch_object($hrs)) 
		{
			$_SESSION["dduserid"] = $row->Id;
			$_SESSION["dduserlevel"] = $row->dengji; 
		} 		
		$hsj= date("Y-m-d H:i:s");
		$hq = "update ".$BIAOTOU."user set loginnum=loginnum+1 ,lastlogintime='$sj' where ddusername='".$hcookieusername."'";	
		mysql_query($hq);
		$_SESSION["duoduouser"] = $hcookieusername; 			 
	}
}

if($_SESSION["duoduouser"]!=NULL){
	$sql="select * from ".$BIAOTOU."user where ddusername='".$_SESSION["duoduouser"]."'";
	$urs = mysql_query($sql);
	while($urow = mysql_fetch_object($urs)) 
	{
		$money=round($urow->money,2); 
		if($money<0)
			$money=0;
		$dengji=$urow->dengji; 
		$_SESSION["dduserlevel"] = $dengji; 
		$txsj=$urow->lasttixian; 
		$txstate=$urow->txstate;
		$jifen=$urow->jifen;
	}

	mysql_query("set names utf8");	
	$hsql="select id from ".$BIAOTOU."msg where ddusername='".$_SESSION["duoduouser"]."' and see=0";
	$hrs = mysql_query($hsql);
	$msgnum = mysql_num_rows($hrs);
}
?>
<div class="user_head">
 <div class="tools">
   <div class="logo"><a href="../index.php"><img src="../template/<?=MOBAN?>/images/logo_redA.png" width="73" height="73" border="0" /></a></div>
   <div <?php if($modtag=="center"){echo "class=\"menu1\"";}else{echo "class=\"menu\"";}?>><a href="/user/center.php">我是米粒</a></div>
   <div <?php if($modtag=="shopcenter"){echo "class=\"menu1\"";}else{echo "class=\"menu\"";}?> class="menu"><a href="/shop/center.php">我是店铺</a></div>
   <div <?php if($modtag=="mng"){echo "class=\"menu1\"";}else{echo "class=\"menu\"";}?>><a href="mingxilist.php?act=in">账号管理</a></div>
   <div <?php if($modtag=="msg"){echo "class=\"menu1\"";}else{echo "class=\"menu\"";}?>>
     <div class="msg"><font style="font-size:1.2em;color:#FFF"><b><?php if($msgnum>0){ echo $msgnum;}?></b></font></div>
     <div class="msg" style="margin-top:0px"><a href="/user/msg_list.php?act=in">消息</a></div>
   </div>
   <div class="right"><a href="../index.php" onmousemove="tip(1);" >优米库首页</a><img src="../template/<?=MOBAN?>/images/toparrow1.gif" width="5"  height="3" border="0" /> <a href='<?=$navheadurl?>user/msg_list.php?act=send'>咨询优优助手</a><a href='<?=$navheadurl?>user/msg_list.php?act=send'> 提意见给客服</a></div>
 </div> 
</div>

<div class="dhmenu" id="tipnav" onmouseout="tip1();" style="display:none;margin-top:75px;">
  <div class="fm">
  <a class="active">攒米</a><a href='../malllist.php'>返米店铺</a><a href='tuiguang_url.php'>免费攒米</a><a class="active">兑换</a><a href="../huan.php">用米兑换</a><a href="tixian.php">申请提现</a>
  <a href='#' class="active">社区</a><a href='../baobeilist.php'>米粒晒吧</a>
  <br /><a class="active">店铺</a><a href='#'>优米联盟</a>
  </div>
</div>  